<!--{template /module/admin/view/head}-->
<div id="left_layout">
	<div id="main_content" class="container-fluid">
		<!--{template /module/admin/view/head_nav}-->
		<div class="row-fluid">
			<div class="well widget">
				<div class="widget-header">
					<p class="text">* {lang admin.validate.require}</p>
				</div>
				<form method="post" action="{$ADMIN_SCRIPT}/admin/setting" onsubmit="javascript:return check_form(this);">
					<input type="hidden" name="formsubmit" value="yes" />
					<input type="hidden" name="hdnSiteLogo" value="{$setting_array[SiteLogo]}"/>
					
					<fieldset>
						<label>{lang admin.setting_site.view.product.label} *</label>
						<input type="text" class="input-xlarge" name="txtProductName" placeholder="{lang admin.setting_site.view.product.placeholder}..." maxlength="32" value="{$setting_array[ProductName]}" />
						<span class="help-inline">{lang admin.setting_site.view.product.tips}</span>
						
						<label>{lang admin.setting_site.view.name.label} *</label>
						<input type="text" class="input-xlarge" name="txtSiteName" placeholder="{lang admin.setting_site.view.name.placeholder}..." maxlength="50" value="{$setting_array[SiteName]}" />
						<span class="help-inline">{lang admin.setting_site.view.name.tips}</span>
						
						<label>{lang admin.setting_site.view.host.label} *</label>
						<input type="text" class="input-xlarge" name="txtSiteHost" placeholder="{lang admin.setting_site.view.host.placeholder}..." maxlength="50" value="{$setting_array[SiteHost]}" />
						<span class="help-inline">{lang admin.setting_site.view.host.tips}</span>
						
						<label>{lang admin.setting_site.view.company.label}</label>
						<input type="text" class="input-xlarge" name="txtCompanyName" maxlength="50" value="{$setting_array[CompanyName]}" />
						<span class="help-inline">{lang admin.setting_site.view.company.tips}</span>
						
						<label>{lang admin.setting_site.view.phone.label}</label>
						<input type="text" class="input-xlarge" name="txtSitePhone" maxlength="30" value="{$setting_array[SitePhone]}" />
						<span class="help-inline">{lang admin.setting_site.view.phone.tips}</span>
						
						<label>{lang admin.setting_site.view.email.label}</label>
						<input type="text" class="input-xlarge" name="txtSiteEmail" maxlength="50" value="{$setting_array[SiteEmail]}" />
						<span class="help-inline">{lang admin.setting_site.view.email.tips}</span>
						
						<label>{lang admin.setting_site.view.address.label}</label>
						<input type="text" class="input-xxlarge" name="txtSiteAddress" maxlength="100" value="{$setting_array[SiteAddress]}" />
						<span class="help-inline">{lang admin.setting_site.view.address.tips}</span>
						
						<hr/>
						<label>{lang admin.setting_site.view.copyright.label} *</label>
						<input type="text" class="input-xxlarge" name="txtCopyright" placeholder="{lang admin.setting_site.view.copyright.pladeholder}..." maxlength="100" value="{$setting_array[Copyright]}" />
						<span class="help-inline">{lang admin.setting_site.view.copyright.tips}</span>
						
						<label>{lang admin.setting_site.view.copyright.text.label}</label>
						<textarea class="span8" rows="3" id="txt_copyright_text" name="txtCopyrightText">{$setting_array[CopyrightText]}</textarea>
						<span class="help-inline">{lang admin.setting_site.view.copyright.text.tips}</span>
						
						<hr/>
						<label>{lang admin.setting_site.view.close.label}</label>
						<label class="checkbox inline">
							<input class="fancy" name="rdoSiteIsClosed"type="radio" value="0" {if $setting_array['SiteIsClosed'] != 1}checked="checked"{/if}/>{lang admin.setting_site.view.close.enabled}
						</label>
						<label class="checkbox inline">
							<input class="fancy" name="rdoSiteIsClosed" type="radio" value="1" {if $setting_array['SiteIsClosed'] == 1}checked="checked"{/if}/>{lang admin.setting_site.view.close.disenabled}
						</label>
						<span class="help-inline">{lang admin.setting_site.view.close.tips}</span>
						
						<div id="div_close_reson" style="display:{echo $setting_array['SiteIsClosed'] == 1 ? '' : 'none';}">
							<hr/>
							<label>{lang admin.setting_site.view.close.reason.label}</label>
							<textarea class="span8" rows="4" name="txtSiteClosedReason">{$setting_array[SiteClosedReason]}</textarea>
							<br/>
							<span class="help-inline">{lang admin.setting_site.view.close.reason.tips}</span>
						</div>
						
						<hr/>
						<label>{lang admin.setting_site.view.icp.label}</label>
						<label class="checkbox inline">
							<input class="fancy" name="rdoSiteIsShowIcp" type="radio" value="1" {if $setting_array['SiteIsShowIcp'] == 1}checked="checked"{/if}/>{lang admin.setting_site.view.icp.enabled}
						</label>
						<label class="checkbox inline">
							<input class="fancy" name="rdoSiteIsShowIcp" type="radio" value="0" {if $setting_array['SiteIsShowIcp'] != 1}checked="checked"{/if}/>{lang admin.setting_site.view.icp.disenabled}
						</label>
						<span class="help-inline">{lang admin.setting_site.view.icp.tips}</span>
						
						<div id="div_site_icp" style="display:{echo $setting_array['SiteIsShowIcp'] == 1 ? '' : 'none';}">
							<hr/>
							<label>{lang admin.setting_site.view.icp.text.label}</label>
							<input type="text" class="input-xlarge" name="txtSiteIcp" maxlength="32" value="{$setting_array[SiteIcp]}" />
							<span class="help-inline">{lang admin.setting_site.view.icp.text.tips}</span>
						</div>
						
						<hr/>
						<label>{lang admin.setting_site.view.image.label}</label>
						<input type="text" class="input-mini" name="txtImageWidth" maxlength="6" value="{$setting_array[ImageWidth]}" /> * 
						<input type="text" class="input-mini" name="txtImageHeight" maxlength="6" value="{$setting_array[ImageHeight]}" /> 
						<span class="help-inline">{lang admin.setting_site.view.image.tips}</span>
						
						<hr/>
						<label>{lang admin.setting_site.view.logo.label}</label>
						<table class="swfupload">
							<tr>
								<td>
									<p class="img" id="p_image">
										<!--{if is_array($setting_array['SiteLogo'])}-->
										<img src="{$setting_array[SiteLogo][0]}" data="{$setting_array[SiteLogo][4]}" width="200" style="width:200px;" border="0"/>
										<!--{else}-->
										<img src="static/images/no-picture.jpg" width="200" style="width:200px;" />
										<!--{/if}-->
									</p>
									
									<hr/>
									
									<div id="divFileUploadButton" class="upload-button"><span id="spnButtonPlaceholder"></span></div>
									<div id="divFileProgressContainer" class="upload-progress"></div>
								</td>
							</tr>
						</table>
						
						<hr/>
						<label>{lang admin.setting_site.view.thumb.label}</label>
						<input type="text" class="input-mini" name="txtThumbWidth" maxlength="6" value="{$setting_array[ThumbWidth]}" /> * 
						<input type="text" class="input-mini" name="txtThumbHeight" maxlength="6" value="{$setting_array[ThumbHeight]}" /> 
						<span class="help-inline">{lang admin.setting_site.view.thumb.tips}</span>
						
						<hr/>
						<label>{lang admin.setting_site.view.new.label}</label>
						<input type="text" class="input-mini" name="txtNewDays" maxlength="4" value="{$setting_array[NewDays]}" />
						<span class="help-inline">{lang admin.setting_site.view.new.tips}</span>
						
						<hr/>
						<label>{lang admin.setting_site.view.theme.label} *</label>
						<input type="text" class="input-large" name="txtSiteTheme" placeholder="{lang admin.setting_site.view.theme.placeholder}..." maxlength="32" value="{$setting_array[SiteTheme]}" /> 
						<span class="help-inline">{lang admin.setting_site.view.theme.tips}</span>
						
						<label>{lang admin.setting_site.view.index.label} *</label>
						<input type="text" class="input-small" name="txtSiteIndex" placeholder="{lang admin.setting_site.view.index.placeholder}..." maxlength="10" value="{$setting_array[SiteIndex]}" /> .htm
						<span class="help-inline">{lang admin.setting_site.view.index.tips}</span>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxMobileEnabled" type="checkbox" class="fancy" value="1" {if $setting_array['MobileEnabled'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.mobile.label}
							<span class="help-inline">{lang admin.setting_site.view.mobile.tips}</span>
						</label>
						
						<div id="div_mobile" style="{echo $setting_array['MobileEnabled'] == 1 ? '' : 'display:none;';}">
							<hr/>
							<label>{lang admin.setting_site.view.mobile.index.label}</label>
							<input type="text" class="input-large" name="txtMobileIndex" maxlength="10" placeholder="{lang admin.setting_site.view.mobile.index.placeholder}..." value="{$setting_array[MobileIndex]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.mobile.index.tips}</span>
						</div>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxThirdSms" type="checkbox" class="fancy" value="1" {if $setting_array['ThirdSms'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.third.sms.label}
						</label>
						<span class="help-inline">{lang admin.setting_site.view.third.sms.tips}</span>
						
						<div id="div_sms" style="{echo $setting_array['ThirdSms'] == 1 ? '' : 'display:none;';}">
							<hr/>
							<p class="muted">
								{lang admin.setting_site.view.third.sms.text}
							</p>
							<label>{lang admin.setting_site.view.third.sms.key.label}</label>
							<input type="text" class="input-xlarge" name="txtSmsKey" maxlength="50" value="{$setting_array[SmsKey]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.sms.key.tips}</span>
							
							<label>{lang admin.setting_site.view.third.sms.secret.label}</label>
							<input type="text" class="input-xlarge" name="txtSmsSecret" maxlength="50" value="{$setting_array[SmsSecret]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.sms.secret.tips}</span>
							
							<label>{lang admin.setting_site.view.third.sms.suffix.label}</label>
							<input type="text" class="input-xlarge" name="txtSmsSuffix" maxlength="20" value="{$setting_array[SmsSuffix]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.sms.suffix.label}</span>
						</div>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxThirdSMTP" type="checkbox" class="fancy" value="1" {if $setting_array['ThirdSMTP'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.third.smtp.label}
						</label>
						<span class="help-inline">{lang admin.setting_site.view.third.smtp.tips}</span>
						
						<div id="div_smtp" style="{echo $setting_array['ThirdSMTP'] == 1 ? '' : 'display:none;';}">
							<hr/>
							<label>{lang admin.setting_site.view.third.smtp.host.label}</label>
							<input type="text" class="input-large" name="txtSmtpHost" maxlength="50" value="{$setting_array[SmtpHost]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.smtp.host.tips}</span>
							
							<label>{lang admin.setting_site.view.third.smtp.port.label}</label>
							<input type="text" class="input-mini" name="txtSmtpPort" maxlength="4" value="{$setting_array[SmtpPort]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.smtp.port.tips}</span>
							
							<label>{lang admin.setting_site.view.third.smtp.user.label}</label>
							<input type="text" class="input-large" name="txtSmtpUser" maxlength="50" value="{$setting_array[SmtpUser]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.smtp.user.tips}</span>
							
							<label>{lang admin.setting_site.view.third.smtp.password.label}</label>
							<input type="text" class="input" name="txtSmtpPassword" maxlength="20" value="{$setting_array[SmtpPassword]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.smtp.password.tips}</span>
						</div>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxThirdWeixin" type="checkbox" class="fancy" value="1" {if $setting_array['ThirdWeixin'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.third.weixin.label}
						</label>
						<span class="help-inline">{lang admin.setting_site.view.third.weixin.tips}</span>
						
						<div id="div_weixin" style="{echo $setting_array['ThirdWeixin'] == 1 ? '' : 'display:none;';}">
							<hr/>
							<label>{lang admin.setting_site.view.third.weixin.appid.label}</label>
							<input type="text" class="input-large" name="txtThirdWeixinAppID" maxlength="50" value="{$setting_array[ThirdWeixinAppID]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.weixin.appid.tips}</span>
							
							<label>{lang admin.setting_site.view.third.weixin.appsecret.label}</label>
							<input type="text" class="input-xlarge" name="txtThirdWeixinAppSecret" maxlength="100" value="{$setting_array[ThirdWeixinAppSecret]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.weixin.appsecret.tips}</span>
						</div>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxThirdQQ" type="checkbox" class="fancy" value="1" {if $setting_array['ThirdQQ'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.third.qq.label}
						</label>
						<span class="help-inline">{lang admin.setting_site.view.third.qq.tips}</span>
						
						<div id="div_qq" style="{echo $setting_array['ThirdQQ'] == 1 ? '' : 'display:none;';}">
							<hr/>
							<label>{lang admin.setting_site.view.third.qq.appid.label}</label>
							<input type="text" class="input-large" name="txtThirdQQAppID" maxlength="50" value="{$setting_array[ThirdQQAppID]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.qq.appid.tips}</span>
							
							<label>{lang admin.setting_site.view.third.qq.appkey.label}</label>
							<input type="text" class="input-xlarge" name="txtThirdQQAppKey" maxlength="100" value="{$setting_array[ThirdQQAppKey]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.qq.appkey.tips}</span>
						</div>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxThirdWeibo" type="checkbox" class="fancy" value="1" {if $setting_array['ThirdWeibo'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.third.weibo.label}
						</label>
						<span class="help-inline">{lang admin.setting_site.view.third.weibo.tips}</span>
						
						<div id="div_weibo" style="{echo $setting_array['ThirdWeibo'] == 1 ? '' : 'display:none;';}">
							<hr/>
							<label>{lang admin.setting_site.view.third.weibo.appkey.label}</label>
							<input type="text" class="input-large" name="txtThirdWeiboAppKey" maxlength="50" value="{$setting_array[ThirdWeiboAppKey]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.weibo.appkey.tips}</span>
							
							<label>{lang admin.setting_site.view.third.weibo.appsecret.label}</label>
							<input type="text" class="input-xlarge" name="txtThirdWeiboAppSecret" maxlength="100" value="{$setting_array[ThirdWeiboAppSecret]}" /> 
							<span class="help-inline">{lang admin.setting_site.view.third.weibo.appsecret.tips}</span>
						</div>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxViewLog" type="checkbox" class="fancy" value="1" {if $setting_array['ViewLog'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.viewlog.label}
							<span class="help-inline">{lang admin.setting_site.view.viewlog.tips}</span>
						</label>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxCheckUpdating" type="checkbox" class="fancy" value="1" {if $setting_array['CheckUpdating'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.updating.label}
							<span class="help-inline">{lang admin.setting_site.view.updating.tips}</span>
						</label>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxSiteTemplateCache" type="checkbox" class="fancy" value="1" {if $setting_array['SiteTemplateCache'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.cache.label}
							<span class="help-inline">{lang admin.setting_site.view.cache.tips}</span>
						</label>
						
						<hr/>
						<label class="checkbox inline">
							<input name="cbxSiteLogDatabase" type="checkbox" class="fancy" value="1" {if $setting_array['SiteLogDatabase'] == 1}checked="checked"{/if} /> {lang admin.setting_site.view.log.database.label}
							<span class="help-inline">{lang admin.setting_site.view.log.database.tips}</span>
						</label>
						
						<!--{if $_var[current][USERID] == -1}-->
						<hr/>
						<label>{lang admin.setting_site.view.help.label}</label>
						<textarea class="span8" name="txtHelpAdminFile" rows="2">{$setting_array[HelpAdminFile]}</textarea>
						<br/>
						<span class="help-inline">{lang admin.setting_site.view.help.tips}</span>
						<!--{/if}-->
						
						<hr/>
						<button type="submit" class="btn btn-small btn-primary" {$dispatches[operations][setup]}>{lang admin.operation.submit}</button>
						<button type="reset" class="btn btn-small">{lang admin.operation.reset}</button>
						<button type="button" class="btn btn-small btn-cache" {$dispatches[operations][setup]}>{lang admin.setting_site.view.cache.clear}</button>
					</fieldset>
				</form>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript" src="editor/kindeditor.js"></script>
<script type="text/javascript" src="editor/lang/zh_CN.js"></script>

<script type="text/javascript" src="static/plugins/swfupload.js"></script>
<script type="text/javascript" src="static/plugins/swfupload_handlers.js"></script>
<script type="text/javascript" src="static/plugins/swfupload_images.js"></script>

<script>
var swfu;
swfupload_params.limit = 1;
swfupload_params.uploaded = 0;

function fileQueueError(file, errorCode, message) {
	if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
		$.dialog({message:'{lang admin.validate.swfupload.lang.limit}'});
	}else{
		$.dialog({message:'{lang admin.validate.swfupload.echo.fail}'});
	}
}

function uploadSuccess(file, serverData) {
	if(serverData.substring(0, 7) === "FILEID:") {
		var photoPath = formatFilePath(serverData.substring(7));
		$('#p_image img').attr('src', photoPath).attr('data', serverData.substring(7));
	}else $.dialog({message:serverData});
}

function check_form(frm){
	if(frm.txtProductName.value.trim().length == 0){
		$(frm.txtProductName).next('.help-inline').css('color', 'red');
		frm.txtProductName.focus();
		return false;
	}
	
	if(frm.txtCopyright.value.trim().length == 0){
		$(frm.txtCopyright).next('.help-inline').css('color', 'red');
		frm.txtCopyright.focus();
		return false;
	}
	
	if(frm.txtSiteHost.value.trim().length == 0){
		$(frm.txtSiteHost).next('.help-inline').css('color', 'red');
		frm.txtSiteHost.focus();
		return false;
	}
	
	if(frm.txtSiteName.value.trim().length == 0){
		$(frm.txtSiteName).next('.help-inline').css('color', 'red');
		frm.txtSiteName.focus();
		return false;
	}
	
	if(frm.rdoSiteIsShowIcp[0].checked && frm.txtSiteIcp.value.trim().length == 0){
		$(frm.txtSiteIcp).next('.help-inline').css('color', 'red');
		frm.txtSiteIcp.focus();
		return false;
	}
	
	if(frm.rdoSiteIsClosed[1].checked && frm.txtSiteClosedReason.value.trim().length == 0){
		$(frm.txtSiteClosedReason).next('.help-inline').css('color', 'red');
		frm.txtSiteClosedReason.focus();
		return false;
	}
	
	if(frm.txtSiteIndex.value.trim().length == 0){
		$(frm.txtSiteIndex).next('.help-inline').css('color', 'red');
		frm.txtSiteIndex.focus();
		return false;
	}
	if(frm.txtSiteTheme.value.trim().length == 0){
		$(frm.txtSiteTheme).next('.help-inline').css('color', 'red');
		frm.txtSiteTheme.focus();
		return false;
	}
	
	if(frm.cbxThirdSMTP.checked){
		if(frm.txtSmtpHost.value.trim().length == 0){
			$(frm.txtSmtpHost).next('.help-inline').css('color', 'red');
			frm.txtSmtpHost.focus();
			return false;
		}
		
		if(frm.txtSmtpPort.value.trim().length == 0){
			$(frm.txtSmtpPort).next('.help-inline').css('color', 'red');
			frm.txtSmtpPort.focus();
			return false;
		}
		
		if(frm.txtSmtpUser.value.trim().length == 0){
			$(frm.txtSmtpUser).next('.help-inline').css('color', 'red');
			frm.txtSmtpUser.focus();
			return false;
		}
		
		if(frm.txtSmtpPassword.value.trim().length == 0){
			$(frm.txtSmtpPassword).next('.help-inline').css('color', 'red');
			frm.txtSmtpPassword.focus();
			return false;
		}
	}
	
	if(frm.cbxThirdQQ.checked){
		if(frm.txtThirdQQAppID.value.trim().length == 0){
			$(frm.txtThirdQQAppID).next('.help-inline').css('color', 'red');
			frm.txtThirdQQAppID.focus();
			return false;
		}
		
		if(frm.txtThirdQQAppKey.value.trim().length == 0){
			$(frm.txtThirdQQAppKey).next('.help-inline').css('color', 'red');
			frm.txtThirdQQAppKey.focus();
			return false;
		}
	}
	
	if(frm.cbxThirdWeibo.checked){
		if(frm.txtThirdWeiboAppKey.value.trim().length == 0){
			$(frm.txtThirdWeiboAppKey).next('.help-inline').css('color', 'red');
			frm.txtThirdWeiboAppKey.focus();
			return false;
		}
		
		if(frm.txtThirdWeiboAppSecret.value.trim().length == 0){
			$(frm.txtThirdWeiboAppSecret).next('.help-inline').css('color', 'red');
			frm.txtThirdWeiboAppSecret.focus();
			return false;
		}
	}
	
	frm.hdnSiteLogo.value = $('#p_image img').attr('data') ? $('#p_image img').attr('data') : '';
	
	return true;
}

var editorConfig = {
	resizeType : 0, 
	items : ['source', '|', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'justifyleft', 'justifycenter', 'justifyright']
};

$(function(){
	$('.fancy').uniform();
	$('fieldset input,textarea,select').blur(function(){
		$(this).next('.help-inline').css('color', '#333');
	});
	
	$('.input-time').datetimepicker({format: 'yyyy-mm-dd hh:ii', autoclose:true, todayBtn:true});
	
	
	$("input[name='rdoSiteIsClosed']").click(function(){
		if(this.value == '1') $('#div_close_reson').show();
		else $('#div_close_reson').hide();
	});
	
	$("input[name='rdoSiteIsShowIcp']").click(function(){
		if(this.value == '1') $('#div_site_icp').show();
		else $('#div_site_icp').hide();
	});
	
	$("input[name='cbxThirdSms']").click(function(){
		if(this.checked) $('#div_sms').show();
		else $('#div_sms').hide();
	});
	
	$("input[name='cbxThirdSMTP']").click(function(){
		if(this.checked) $('#div_smtp').show();
		else $('#div_smtp').hide();
	});
	
	$("input[name='cbxThirdWeixin']").click(function(){
		if(this.checked) $('#div_weixin').show();
		else $('#div_weixin').hide();
	});
	
	$("input[name='cbxThirdQQ']").click(function(){
		if(this.checked) $('#div_qq').show();
		else $('#div_qq').hide();
	});
	
	$("input[name='cbxThirdWeibo']").click(function(){
		if(this.checked) $('#div_weibo').show();
		else $('#div_weibo').hide();
	});
	
	$("input[name='cbxMobileEnabled']").click(function(){
		if(this.checked) $('#div_mobile').show();
		else $('#div_mobile').hide();
	});
	
	$('.btn-cache').click(function(){
		$.getJSON('{$ADMIN_SCRIPT}/admin/setting/_clear&rnd=' + Math.random(), {}, function(data){
			$.dialog({message:data.message});
		});
	});
	
	$('.swfupload img').dblclick(function(){
		$(this).attr({src:'static/images/no-picture.jpg', data:''});
	});
	
	$('#a_help_admin_file_delete').click(function(){
		$("input[name='hdnHelpAdminFile']").val('');
		$('#span_help_admin_file a').remove();
	});
	
	swfu = new SWFUpload({
		upload_url: "{$ADMIN_SCRIPT}/admin/setting/_upload&_SALT={$_var[current][SALT]}",
		
		file_size_limit : "200KB", 
		file_types : "*.jpg;*.png",
		file_types_description : "PNG/GIF Images",
		file_upload_limit : "0",
		
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		
		button_image_url : "static/images/swfupload/swfupload.png",
		button_placeholder_id : "spnButtonPlaceholder",
		button_width: 150,
		button_height: 18,
		button_text : '{lang admin.validate.swfupload.lang.button}({lang admin.validate.swfupload.lang.button.size.200})',
		button_text_style : '',
		button_text_top_padding: 0,
		button_text_left_padding: 18,
		
		flash_url : "static/swfupload.swf",
		
		custom_settings : {
			upload_target : "divFileProgressContainer"
		},
		
		debug: false
	});
	
	KindEditor.create('#txt_copyright_text', editorConfig);
});
</script>

<!--{template /module/admin/view/foot}-->